package hn.cch.grammar.binary;

import java.util.HashMap;
import java.util.Map;
import java.util.UUID;

public class JVisualVMDemo {

    private static final Map<String, Object> map = new HashMap<>();

    public static void main(String[] args) {

        try {
            Thread.sleep(10000);
        } catch (InterruptedException e) {
            System.out.println(e.getMessage());
        }
        System.out.println("one");
        for (int i = 0; i < 1000000; i++) {
            String value = UUID.randomUUID().toString();
            map.put("key_one_" + i, value);
        }
        try {
            Thread.sleep(10000);
        } catch (InterruptedException e) {
            System.out.println(e.getMessage());
        }
        System.out.println("two");
        for (int i = 0; i < 1000000; i++) {
            String value = UUID.randomUUID().toString();
            map.put("key_two_" + i, value);
        }
        try {
            Thread.sleep(10000);
        } catch (InterruptedException e) {
            System.out.println(e.getMessage());
        }
        System.out.println("three");
        for (int i = 0; i < 1000000; i++) {
            String value = UUID.randomUUID().toString();
            map.put("key_three_" + i, value);
        }
        try {
            Thread.sleep(10000);
        } catch (InterruptedException e) {
            System.out.println(e.getMessage());
        }
        System.out.println("four");
        for (int i = 0; i < 1000000; i++) {
            String value = UUID.randomUUID().toString();
            map.put("key_four_" + i, value);
        }
        try {
            Thread.sleep(10000);
        } catch (InterruptedException e) {
            System.out.println(e.getMessage());
        }
        System.out.println("five");
        for (int i = 0; i < 1000000; i++) {
            String value = UUID.randomUUID().toString();
            map.put("key_five_" + i, value);
        }
    }
}
